home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_spinnerbots.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  147 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_SpinnerBots.cog
  4. #
  5. # [SXC]
  6. #
  7. # Controls the spinner bots in the chapel
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message        startup
  16.     message        entered
  17.     message     damaged
  18.     message     activate
  19.     message     killed
  20.  
  21.     thing        player                            local
  22.     
  23.     thing       spinbot0                        linkid=2
  24.     thing       spinbot1                        linkid=2
  25.     thing       spinbot2                        linkid=2
  26.     thing       cutscenebutton
  27.     
  28.     sector      tripsector
  29.     sector      hallsector
  30.     sector      restartsector
  31.     
  32.     int         enterflag=0                     local
  33.     int         killflag=0                      local
  34.     int         damageflag=0                    local
  35.     int         botflag=0                       local
  36.     int         bothealth=0                     local
  37.  
  38. end
  39.  
  40. # ================================================================================
  41.     
  42. code
  43.  
  44. # --------------------------------------------------------------------------------
  45.  
  46. startup:
  47.  
  48.     AISetCutsceneMode(spinbot0);
  49.     AISetCutsceneMode(spinbot1);
  50.     AISetCutsceneMode(spinbot2);
  51.     player = GetLocalPlayerThing();
  52.     
  53. return;
  54.  
  55. # --------------------------------------------------------------------------------
  56.  
  57. entered:
  58.  
  59.     if ((GetSenderRef() == tripsector) && (GetSourceRef() == player))
  60.     {
  61.         enterflag = 1;
  62.         AIClearCutsceneMode(spinbot0);
  63.         AIClearCutsceneMode(spinbot1);
  64.     }
  65.     
  66.     if ((GetSenderRef() == hallsector) && (GetSourceRef() == player))
  67.     {
  68.         AISetCutsceneMode(spinbot0);
  69.         AISetCutsceneMode(spinbot1);
  70.         AISetCutsceneMode(spinbot2);
  71.     }
  72.     
  73.     if ((GetSenderRef() == restartsector) && (GetSourceRef() == player))
  74.     {
  75.         AIClearCutsceneMode(spinbot0);
  76.         AIClearCutsceneMode(spinbot1);
  77.         AIClearCutsceneMode(spinbot2);
  78.     }
  79.     
  80. return;
  81.  
  82. # --------------------------------------------------------------------------------
  83.  
  84. damaged:
  85.  
  86.     if ((GetSenderRef() == spinbot2) && (botflag == 0))
  87.     {
  88.         botflag = 1;
  89.         bothealth = GetThingMaxHealth(spinbot2);
  90.         SetThingHealth(spinbot2, bothealth);
  91.         AIClearCutsceneMode(spinbot2);
  92.     }
  93.     
  94. return;
  95.     
  96. # --------------------------------------------------------------------------------
  97.  
  98. killed:
  99.  
  100.     if (GetSenderRef() == spinbot0)
  101.     {
  102.         spinbot0 = -1;
  103.     }
  104.     
  105.     if (GetSenderRef() == spinbot1)
  106.     {
  107.         spinbot1 = -1;
  108.     }
  109.     
  110.     if (GetSenderRef() == spinbot2)
  111.     {
  112.         spinbot2 = -1;
  113.     }
  114.     
  115. return;    
  116.  
  117. # --------------------------------------------------------------------------------
  118.  
  119. activate:
  120.     
  121.     if (GetSenderRef() == cutscenebutton)
  122.     {
  123.         if (spinbot0 != -1)
  124.         {
  125.             SetThingFlags(spinbot0, 0x80000);
  126.         }
  127.         
  128.         if (spinbot1 != -1)
  129.         {
  130.             SetThingFlags(spinbot1, 0x80000);
  131.         }
  132.         
  133.         if (spinbot2 != -1)
  134.         {
  135.             SetThingFlags(spinbot2, 0x80000);
  136.         }    
  137.         
  138.     }
  139.     
  140. return;
  141.         
  142. # --------------------------------------------------------------------------------
  143.  
  144. end
  145.  
  146.  
  147.